<?php  
foreach($settings as $settings_rec){
	if($settings_rec['jonu_setting_id'] == "adm_pagination"){
		$adm_pagination = $settings_rec['jonu_setting_value'];
	}else if($settings_rec['jonu_setting_id'] == "home_pagination"){
		$home_pagination = $settings_rec['jonu_setting_value'];
	}else if($settings_rec['jonu_setting_id'] == "post_status"){
		$post_status = $settings_rec['jonu_setting_value'];
	}else if($settings_rec['jonu_setting_id'] == "user_pagination"){
		$usr_pagination = $settings_rec['jonu_setting_value'];
	}else if($settings_rec['jonu_setting_id'] == "recom_post"){
		$recommend = $settings_rec['jonu_setting_value'];
	}else if($settings_rec['jonu_setting_id'] == "trending"){
		$trending = $settings_rec['jonu_setting_value'];
	}
}
?>
<form action="<?php echo site_url('mimin_jonu/update_settings') ?>" method="post">
	<table class="table table-striped">
		<tr>
			<th colspan="5">Basic Settings</th>
		</tr>
		<tr>
			<td width="15%">Admin Pagination</td>
			<td width="35%">
				<select name="adm_pagination" class="form-control input-sm">
					<?php for($adm_paginate=1; $adm_paginate<=8; $adm_paginate++): ?>
						<?php if($adm_pagination == $adm_paginate): ?>
							<option value="<?php echo $adm_paginate ?>" selected="selected"><?php echo $adm_paginate ?> Data</option>
						<?php else: ?>
							<option value="<?php echo $adm_paginate ?>"><?php echo $adm_paginate ?> Data</option>
						<?php endif; ?>
					<?php endfor; ?>
				</select>
			</td>
			<td></td>
			<td width="15%">Home Pagination</td>
			<td width="35%">
				<select name="home_pagination" class="form-control input-sm">
					<?php for($home_paginate=1; $home_paginate<=10; $home_paginate++): ?>
						<?php if($home_pagination == $home_paginate): ?>
							<option value="<?php echo $home_paginate ?>" selected="selected"><?php echo $home_paginate ?> Data</option>
						<?php else: ?>
							<option value="<?php echo $home_paginate ?>"><?php echo $home_paginate ?> Data</option>
						<?php endif; ?>
					<?php endfor; ?>
				</select>
			</td>
		</tr>
		<tr>
			<td>Default Post Status</td>
			<td>
				<div class="btn-group" data-toggle="buttons">
					<?php if($post_status == "Published"): ?>
						<label class="btn btn-danger btn-sm active">
							<input type="radio" name="post_status" value="Published" checked="checked"> Published
						</label>
					<?php else: ?>
						<label class="btn btn-danger btn-sm">
							<input type="radio" name="post_status" value="Published"> Published
						</label>
					<?php endif; ?>

					<?php if($post_status == "Pending"): ?>
						<label class="btn btn-danger btn-sm active" checked="checked">
							<input type="radio" name="post_status" value="Pending"> Pending
						</label>
					<?php else: ?>
						<label class="btn btn-danger btn-sm">
							<input type="radio" name="post_status" value="Pending"> Pending
						</label>
					<?php endif; ?>
				</div>
			</td>
			<td></td><!-- leave it blank -->
			<td>User Pagination</td>
			<td>
				<select name="usr_pagination" class="form-control input-sm">
					<?php for($usr_paginate=1; $usr_paginate<=8; $usr_paginate++): ?>
						<?php if($usr_pagination == $usr_paginate): ?>
							<option value="<?php echo $usr_paginate ?>" selected="selected"><?php echo $usr_paginate ?> Data</option>
						<?php else: ?>
							<option value="<?php echo $usr_paginate ?>"><?php echo $usr_paginate ?> Data</option>
						<?php endif; ?>
					<?php endfor; ?>
				</select>
			</td>
		</tr>
		<tr>
			<td>Recommended Posts</td>
			<td>
				<select name="recom_post" class="form-control input-sm">
					<?php for($recom_post=1; $recom_post<=10; $recom_post++): ?>
						<?php if($recommend == $recom_post): ?>
							<option value="<?php echo $recom_post ?>" selected="selected"><?php echo $recom_post." Post" ?></option>
						<?php else: ?>
							<option value="<?php echo $recom_post ?>"><?php echo $recom_post." Post" ?></option>
						<?php endif; ?>
					<?php endfor; ?>
				</select>
			</td>
			<td></td>
			<td>Trending</td>
			<td>
				<select name="trending" class="form-control input-sm">
					<?php for($c_trending=1; $c_trending<=10; $c_trending++): ?>
						<?php if($trending == $c_trending): ?>
							<option value="<?php echo $c_trending ?>" selected="selected"><?php echo $c_trending." Post" ?></option>
						<?php else: ?>
							<option value="<?php echo $c_trending ?>"><?php echo $c_trending." Post" ?></option>
						<?php endif; ?>
					<?php endfor; ?>
				</select>
			</td>
		</tr>
	</table>
	<input type="submit" name="btn_update_settings" value="Update Settings" class="btn btn-jonu"/>
</form>